#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Time: 2022/12/22 10:00
# @Author: 余桂林
# @Email: 1151026784@qq.com
# @File.about_pages.py

from selenium.webdriver.common.by import By


class MyPages:
    def __init__(self,driver):
        self.driver = driver

    my_locator = (By.XPATH, '//android.widget.FrameLayout/android.widget.RelativeLayout[1]/android.widget.ImageView[1]')
    left_corner_locator = (By.XPATH, '//android.widget.ImageView[@resource-id=\"com.gfeng.daydaycook:id/menuIv\"]')
    setting_locator = (By.XPATH,'//android.widget.LinearLayout[@resource-id=\"com.gfeng.daydaycook:id/ll_setting\"]/android.widget.ImageView[1]')
    about_us_username_locator = (By.XPATH, '//android.widget.TextView[@resource-id=\"com.gfeng.daydaycook:id/txt_title5\"]')

    def click_btn_my(self):
        self.driver.find_element(*self.my_locator).click()

    def click_btn_left(self):
        self.driver.find_element(*self.left_corner_locator).click()

    def click_btn_setting(self):
        self.driver.find_element(*self.setting_locator).click()

    def click_about(self):
        self.driver.find_element(*self.about_us_username_locator).click()
